/*
 * @Description: 全局margin、padding样式
 * @Autor: 赖维健(lwj1994)
 * @Date: 2021-09-28 11:07:54
 * @LastEditors: 赖维健(lwj1994)
 * @LastEditTime: 2021-09-28 11:10:07
 */
.generate-margin-padding(100);

.generate-margin-padding(@n, @i: 0) when (@i =< @n) {
  /* 全边距 */
  .margin--@{i} {
    margin: ~'@{i}px';
  }
  .padding--@{i} {
    padding: ~'@{i}px';
  }

  /* 上下边距 */
  .margin-top-bottom--@{i} {
    margin-top: ~'@{i}px';
    margin-bottom: ~'@{i}px';
  }
  .padding-top-bottom--@{i} {
    padding-top: ~'@{i}px';
    padding-bottom: ~'@{i}px';
  }

  /* 左右边距 */
  .margin-left-right--@{i} {
    margin-left: ~'@{i}px';
    margin-right: ~'@{i}px';
  }
  .padding-left-right--@{i} {
    padding-left: ~'@{i}px';
    padding-right: ~'@{i}px';
  }

  /* 上边距 */
  .margin-top--@{i} {
    margin-top: ~'@{i}px';
  }
  .padding-top--@{i} {
    padding-top: ~'@{i}px';
  }

  /* 下边距 */
  .margin-bottom--@{i} {
    margin-bottom: ~'@{i}px';
  }
  .padding-bottom--@{i} {
    padding-bottom: ~'@{i}px';
  }

  /* 左边距 */
  .margin-left--@{i} {
    margin-left: ~'@{i}px';
  }
  .padding-left--@{i} {
    padding-left: ~'@{i}px';
  }

  /* 右边距 */
  .margin-right--@{i} {
    margin-right: ~'@{i}px';
  }
  .padding-right--@{i} {
    padding-right: ~'@{i}px';
  }

  .generate-margin-padding(@n, (@i + 1));
}
